package com.pinyou.dashboard.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pinyou.dashboard.mapper.UserMapper;
import com.pinyou.dashboard.pojo.TbUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

/**
 * @Title: testcontroller
 * @Description:
 * @Auther:jzfai
 * @Version: 1.0
 * @create 2020/4/30 21:50
 */
@RestController
public class testcontroller {
  @Autowired
  private UserMapper userMapper;
  @GetMapping("test1")
  public List<TbUser> test1(){
    System.out.println();
    List<TbUser> tbUsers = userMapper.selectList(null);
    return  tbUsers;
  }
  @GetMapping("test2")
  public IPage<TbUser> test2(){
    Page<TbUser> iPage = new Page<>(1, 3);
    IPage<TbUser> iPage1 = userMapper.selectPage(iPage, null);
    return iPage1;
  }
  @GetMapping("test3")
  public List<TbUser> test3(){
    List<TbUser> tbUsers = userMapper.selectBatchIds(Arrays.asList(28, 29, 30));
    return tbUsers;
  }

}
